﻿var Initial_activity_edtitor = function () {
    $("#dialog_activity").dialog({
        autoOpen: false,
        show: "drop",
        hide: "drop",
        height: 600,
        width: 600,
        modal: true,
        buttons: {
            "保存": function () {
                var itemTarget = $('li[activityUpdateMode*="edit"]');
                if (!itemTarget[0]) itemTarget = $('li[activityUpdateMode*="create"]');
                var $dialog = $("#dialog_activity");

                var actname = $dialog.find("#txtActName").val();
                itemTarget.attr("actname", actname);

                var actDuration = $dialog.find("#txtActDuration").val();
                itemTarget.attr("actDuration", actDuration);

                var actApprover = $dialog.find("#txtActApprover").val();
                itemTarget.attr("actApprover", actApprover);

                var approveType = $dialog.find("#ddlApproveType").val();
                itemTarget.attr("approveType", approveType);

                var actSerial = $dialog.find("#rdSerialTrue").attr('checked');
                if (actSerial)
                    itemTarget.attr("actSerial", actSerial);

                itemTarget.attr('activityUpdateMode', "updated");
                $(this).dialog("close");

            },
            "取消": function () {
                $(this).dialog("close");
            }
        },
        close: function () {
        }
    });
}
